home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / LeadingLady.dxr / Internal_7_scroll slider.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  1.3 KB  |  63 lines

  1. property pSprite, spriteNum, pbar, pLine, pGo, ppos, ptext, ptotal
  2.  
  3. on getPropertyDescriptionList me
  4.   return [#pbar: [#comment: " ", #format: #integer, #default: 0], #ptext: [#comment: " ", #format: #string, #default: "ass"]]
  5. end
  6.  
  7. on beginSprite me
  8.   pSprite = sprite(spriteNum)
  9.   pLine = sprite(pbar)
  10.   pSprite.loc = pLine.pTop
  11.   ppos = 0
  12.   pGo = 0
  13.   ptotal = 99
  14.   member("word list").scrollTop = 0
  15. end
  16.  
  17. on mouseDown me
  18.   pGo = 1
  19. end
  20.  
  21. on mouseUp me
  22.   pGo = 0
  23. end
  24.  
  25. on mouseUpOutSide me
  26.   mouseUp(me)
  27. end
  28.  
  29. on positio me
  30.   barl = pLine.pBottom - pLine.pTop
  31.   percent = (pSprite.locV - pLine.pTop) * 100.0 / barl
  32.   total = ptotal
  33.   newscroll = percent * total / 100.0
  34.   member(ptext).scrollTop = newscroll
  35. end
  36.  
  37. on slide me
  38.   ww = ptotal
  39.   ss = member(ptext).scrollTop.float * 100.0 / ww.float
  40.   bart = pLine.pBottom - pLine.pTop
  41.   asd = bart * ss / 100.0
  42.   pSprite.locV = pLine.pTop + asd
  43. end
  44.  
  45. on exitFrame me
  46.   if pGo then
  47.     pSprite.locH = pLine.locH
  48.     pSprite.locV = the mouseV
  49.     if pSprite.locV < pLine.pTop then
  50.       pSprite.locV = pLine.pTop
  51.     else
  52.       if pSprite.locV > pLine.pBottom then
  53.         pSprite.locV = pLine.pBottom
  54.       end if
  55.     end if
  56.     barl = pLine.pBottom - pLine.pTop
  57.     percent = (pSprite.locV - pLine.pTop) * 100.0 / barl
  58.     total = ptotal
  59.     newscroll = percent * total / 100.0
  60.     member(ptext).scrollTop = newscroll
  61.   end if
  62. end
  63.